<template>
	<div class="bigDiv">
		<el-form :inline="true" label-width="100px">
			<div class="topNav">
				<el-button type="text" icon="el-icon-search" @click="getList" style="float:right;">搜索</el-button>
				<el-button type="text" icon="el-icon-refresh" @click="reset"
					style="float:right;margin-right:10px;">重置</el-button>
				<el-button type="text" icon="el-icon-plus" @click="editProduct">新增报修</el-button>
			</div>
			<el-row :gutter="20">
				<div style="margin:0 20px;">
					<el-form-item label="报修单号" prop="no">
						<el-input v-model="queryParams.no" placeholder="请输入报修单号" clearable size="small"
							@keyup.enter.native="getList" />
					</el-form-item>
					<el-form-item label="报修电话" prop="applyPhone">
						<el-input v-model="queryParams.applyPhone" placeholder="请输入报修电话" clearable size="small"
							@keyup.enter.native="getList" />
					</el-form-item>
					<el-form-item label="分类" prop="applyCategory">
						<el-select v-model="queryParams.applyCategory" placeholder="请选择分类" clearable size="small">
							<el-option label="水" value="水"></el-option>
							<el-option label="电" value="电"></el-option>
							<el-option label="其他" value="其他"></el-option>
						</el-select>
					</el-form-item>
					<el-form-item label="商户编号" prop="applyHouse">
						<el-input v-model="queryParams.applyHouse" placeholder="请输入报修商户编号" clearable size="small"
							@keyup.enter.native="getList" />
					</el-form-item>
					<el-form-item label="流程状态" prop="state">
						<el-select v-model="queryParams.state" placeholder="请选择流程状态" clearable size="small">
							<el-option label="待派工" value="待派工"></el-option>
							<el-option label="已派工" value="已派工"></el-option>
							<el-option label="已维修" value="已维修"></el-option>
							<el-option label="已回访" value="已回访"></el-option>
						</el-select>
					</el-form-item>
					<el-form-item label="数据来源" prop="client">
						<el-select v-model="queryParams.client" placeholder="请选择数据来源" clearable size="small">
							<el-option label="pc" value="pc"></el-option>
							<el-option label="小程序" value="小程序"></el-option>
						</el-select>
					</el-form-item>
				</div>
			</el-row>
		</el-form>
		<el-table v-loading="loading" :data="list" border height="calc(100vh - 380px)">
			<el-table-column label="报修单号" align="center" prop="no" />
			<el-table-column label="报修标题" align="center" prop="title" />
			<el-table-column label="分类" align="center" prop="applyCategory" />
			<el-table-column label="报修电话" align="center" prop="applyPhone" />
			<el-table-column label="报修者姓名" align="center" prop="applyName" />
			<el-table-column label="报修时间" align="center" prop="applyTime" width="180"></el-table-column>
			<el-table-column label="流程状态" align="center" prop="state">
			</el-table-column>
			<el-table-column label="数据来源" align="center" prop="client">
			</el-table-column>
			<el-table-column label="操作" align="center" width="250" fixed="right">
				<template slot-scope="scope">
					<div class="centered-content">
						<el-button type="text" size="mini" class="editBtn" @click="editProduct(scope.row)">
							编辑
						</el-button>
						<el-button type="text" size="mini" class="deleteBtn" @click="delProduct(scope.row)">
							删除
						</el-button>
						<el-button v-if="scope.row.state == '待派工'" type="text" size="mini" class="editBtn"  @click="sendWork(scope.row)">
							派工
						</el-button>
						<el-button v-else type="text" size="mini" class="editBtn" disabled @click="sendWork(scope.row)">
							派工
						</el-button>
						<el-button type="text" size="mini" class="detailBtn" @click="lookProduct(scope.row)">
							详情
						</el-button>
						<el-button type="text" size="mini" class="detailBtn" @click="interview(scope.row)">
							回访
						</el-button>
						<el-button type="text" size="mini" class="detailBtn" @click="off(scope.row)">
							关单
						</el-button>
					</div>
				</template>
			</el-table-column>
		</el-table>
		<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum"
			:limit.sync="queryParams.pageSize" @pagination="getList" />

		<!-- 投诉维护弹窗 -->
		<el-dialog title="报修维护" :visible.sync="productModel" :close-on-click-modal="false"
			:close-on-press-escape="false" width="40%">
			<el-form ref="form" :model="dataForm" :rules="rules" label-width="90px" :disabled="canEdit">
				<el-card>
					<div slot="header">
						<span>开单信息</span>
					</div>
					<div>
						<el-col :span="12">
							<el-form-item label="报修电话" prop="applyPhone" v-if="dataForm.client != 'web_company'">
								<el-input v-model="dataForm.applyPhone" placeholder="请输入报修电话" clearable
									:style="{ width: '100%' }"></el-input>
							</el-form-item>
						</el-col>
						<el-col :span="12">
							<el-form-item label="报修人" prop="applyName" v-if="dataForm.client != 'web_company'">
								<el-input v-model="dataForm.applyName" placeholder="请输入报修人名称" clearable
									:style="{ width: '100%' }"></el-input>
							</el-form-item>
						</el-col>
						<el-col :span="12">
							<el-form-item label="报修日期" prop="applyTime" v-if="dataForm.client != 'web_company'">
								<el-date-picker clearable size="small" v-model="dataForm.appointmentTime"
									type="datetime" value-format="yyyy-MM-dd" placeholder="选择预约时间"></el-date-picker>
							</el-form-item>
						</el-col>
						<el-col :span="12">
							<el-form-item label="接待人员" prop="createBy" v-if="dataForm.client != 'web_company'">
								<el-input v-model="dataForm.createBy" placeholder="请输入接待人员名称" clearable
									:style="{ width: '100%' }"></el-input>
							</el-form-item>
						</el-col>
						<el-col :span="24">
							<el-form-item label="房间编号" prop="applyHouse" v-if="dataForm.client != 'web_company'">
								<el-input v-model="dataForm.applyHouse" placeholder="请输入房间编号" clearable
									:style="{ width: '100%' }"></el-input>
							</el-form-item>
						</el-col>

						<!-- <el-col :span="20">
							<el-form-item label="报修编号" prop="applyHouse" v-if="dataForm.client != 'web_company'">
								<el-input v-if="dataForm.appointmentTime + '-' + dataForm.applyHouse != 'undefined-undefined' "
									v-model="dataForm.appointmentTime + '-' + dataForm.applyHouse" disabled
									placeholder="报修编号" clearable :style="{ width: '100%' }"></el-input>
								<el-input v-else v-model="dataForm.appointmentTime" disabled
									placeholder="报修编号" clearable :style="{ width: '100%' }"></el-input>
							</el-form-item>
						</el-col> -->

						<el-col :span="24">
							<el-form-item label="维修分类" prop="applyCategory" v-if="dataForm.client != 'web_company'">
								<el-select v-model="dataForm.applyCategory" placeholder="请选择维修分类">
									<el-option v-for="item in options" :key="item.value" :label="item.label"
										:value="item.value">
									</el-option>
								</el-select>
							</el-form-item>
						</el-col>
						<el-col :span="24">
							<el-form-item label="报修内容" prop="applyContent">
								<el-input v-model="dataForm.applyContent" placeholder="请输入报修的内容说明" :maxlength="200"
									:style="{ width: '100%' }" true type="textarea" :rows="3" />
							</el-form-item>
						</el-col>
						<el-col :span="24">
							<el-form-item label="上传文件">
								<el-upload class="upload-demo" :action="fileUrl" :on-preview="handlePreview"
									:on-remove="handleRemove" :before-remove="beforeRemove"
									:on-success="handleAvatarSuccess" :on-change="onChange" multiple :limit="5"
									:on-exceed="handleExceed" :file-list="fileList" list-type="picture"
									:preview-src-list="fileList">
									<el-button size="small" type="primary">点击上传</el-button>
								</el-upload>
							</el-form-item>
						</el-col>
						<!-- {{fileList}} -->

						<!-- <el-col :span="24" :style="{'margin-left':'10px','margin-bottom': '10px'}">
							<el-button type="primary">
								<el-upload :action="fileUrl" :headers="fileHeaders" :show-file-list="false"
									:file-list="fileList" :on-success="handleAvatarSuccess" :on-remove="handleRemove"
									:on-error="handleAvatarError" multiple :limit="10000">
									<div class="el-upload__text">报修图片</div>
								</el-upload>
							</el-button>
						</el-col> -->

						<!-- <el-col :span="12">
							<el-form-item label="预约时间" prop="appointmentTime" v-if="dataForm.client != 'web_company'">
								<el-date-picker clearable size="small" v-model="dataForm.appointmentTime" type="datetime"
									value-format="yyyy-MM-dd" placeholder="选择预约时间"></el-date-picker>
							</el-form-item>
						</el-col>
						
						
						
						
						<el-col :span="12">
							<el-form-item label="报修分类" prop="applyCategory">
								<el-select v-model="dataForm.applyCategory" placeholder="请选择报修分类" clearable size="small">
									<el-option label="水" value="水"></el-option>
									<el-option label="电" value="电"></el-option>
									<el-option label="电梯" value="电梯"></el-option>
									<el-option label="其他" value="其他"></el-option>
								</el-select>
							</el-form-item>
						</el-col>
						<el-col :span="2">
							<el-button type="primary" @click="">报修回访</el-button>
						</el-col> -->
					</div>
				</el-card>
				<el-card style="margin-top: 5px;">
					<div slot="header">
						<span>派工信息</span>
					</div>
					<div>
						<!-- <el-col :span="12">
							<el-form-item label="报修人员" prop="applyName" :maxlength="20">
								<el-input v-model="dataForm.applyName" placeholder="请输入报修人员" />
							</el-form-item>
						</el-col> -->
						<!-- <el-col :span="12">
							<el-form-item label="维修资材" prop="repairMaterials" :maxlength="20">
								<el-input v-model="dataForm.repairMaterials" placeholder="请输入维修资材" />
							</el-form-item>
						</el-col>
						<el-col :span="12">
							<el-form-item label="完工时间" prop="repairDate" :maxlength="20">
								<el-input v-model="dataForm.repairDate" placeholder="请输入完工时间" />
							</el-form-item>
						</el-col> -->
						<el-col :span="12">
							<el-form-item label="派工单时间" prop="appointmentTime" :maxlength="20">
								<el-input v-model="dataForm.appointmentTime" placeholder="请输入派工单时间" />
							</el-form-item>
						</el-col>
						<el-col :span="12">
							<el-form-item label="派工人员" prop="repairUserName" :maxlength="20">
								<el-input v-model="dataForm.repairUserName" placeholder="请输入派工人员" />
							</el-form-item>
						</el-col>
					</div>
				</el-card>
				<!-- <el-card style="margin-top: 5px;">
					<div slot="header">
						<span>回访信息</span>
					</div>
					<div>
						<el-col :span="12">
							<el-form-item label="回访人" prop="returnUser" :maxlength="20">
								<el-input v-model="dataForm.returnUser" placeholder="请输入回访人" />
							</el-form-item>
						</el-col>
						<el-col :span="12">
							<el-form-item label="回访时间" prop="endTime" :maxlength="20">
								<el-input v-model="dataForm.endTime" placeholder="请输入回访时间" />
							</el-form-item>
						</el-col>
						<el-col :span="12">
							<el-form-item label="回访结果" prop="returnResult " :maxlength="20">
								<el-input v-model="dataForm.returnResult" placeholder="请输入回访结果" />
							</el-form-item>
						</el-col>
					</div>
				</el-card> -->


				<!-- <el-row :gutter="20">
					<el-col :span="12">
						<el-form-item label="数据来源" prop="client">
							<el-select v-model="dataForm.client" placeholder="请选择数据来源" clearable size="small">
								<el-option label="pc" value="pc"></el-option>
								<el-option label="小程序" value="小程序"></el-option>
							</el-select>
						</el-form-item>
					</el-col>
					
					
					<el-col :span="12">
						<el-form-item label="房间列表" prop="applyHouse" v-if="dataForm.client != 'web_company'">
							<el-select v-model="dataForm.applyHouse" placeholder="房间列表" clearable size="small">
								<el-option :label="item.name" :value="item.name" v-for="item in houseList"></el-option>
							</el-select>
						</el-form-item>
					</el-col>
					
					<el-col :span="12">
						<el-form-item label="报修电话" prop="applyPhone" :maxlength="20">
							<el-input v-model="dataForm.applyPhone" placeholder="请输入报修电话" />
						</el-form-item>
					</el-col>
					 -->

				</el-row>
			</el-form>
			<span slot="footer" class="dialog-footer" v-if="!canEdit">
				<el-button @click="productModel = false">取 消</el-button>
				<el-button type="primary" @click="submitProduct()">确 定</el-button>
			</span>
		</el-dialog>
		<el-dialog title="报修维护" :visible.sync="sendWorkModel" :close-on-click-modal="false"
			:close-on-press-escape="false" width="40%">
			<el-form ref="form" :model="dataForm" :rules="rules" label-width="90px" :disabled="canEdit">
				<el-card style="margin-top: 5px;">
					<div slot="header">
						<span>派工信息</span>
					</div>
					<div>
						<el-col :span="12">
							<el-form-item label="派工单时间" prop="appointmentTime" :maxlength="20">
								<el-date-picker v-model="dataForm.appointmentTime" type="datetime" placeholder="选择派工日期时间">
								</el-date-picker>
								<!-- <el-input v-model="dataForm.appointmentTime" placeholder="请输入派工单时间" /> -->
							</el-form-item>
						</el-col>
						<el-col :span="12">
							<el-form-item label="派工人员" prop="repairUserName" :maxlength="20">
								<el-input v-model="dataForm.repairUserName" placeholder="请输入派工人员" />
							</el-form-item>
						</el-col>
					</div>
				</el-card>
				</el-row>
			</el-form>
			<span slot="footer" class="dialog-footer" v-if="!canEdit">
				<el-button @click="sendWorkModel = false">取 消</el-button>
				<el-button type="primary" @click="submitProduct1()">确 定</el-button>
			</span>
		</el-dialog>
		<el-dialog title="回访" :visible.sync="payAReturnVisit" :close-on-click-modal="false"
			:close-on-press-escape="false" width="40%">
			<el-form ref="form" :model="dataForm" :rules="rules" label-width="90px">
				<el-card>
					<div slot="header">
						<span>开单信息</span>
					</div>
					<div>
						<el-col :span="12">
							<el-form-item label="报修电话" prop="applyPhone" v-if="dataForm.client != 'web_company'">
								<el-input v-model="dataForm.applyPhone" placeholder="请输入报修电话" clearable :disabled="canEdit"
									:style="{ width: '100%' }"></el-input>
							</el-form-item>
						</el-col>
						<el-col :span="12">
							<el-form-item label="报修人" prop="applyName" v-if="dataForm.client != 'web_company'">
								<el-input v-model="dataForm.applyName" placeholder="请输入报修人名称" clearable :disabled="canEdit"
									:style="{ width: '100%' }"></el-input>
							</el-form-item>
						</el-col>
						<el-col :span="12">
							<el-form-item label="报修日期" prop="applyTime" v-if="dataForm.client != 'web_company'">
								<el-date-picker clearable size="small" v-model="dataForm.appointmentTime" :disabled="canEdit"
									type="datetime" value-format="yyyy-MM-dd" placeholder="选择预约时间"></el-date-picker>
							</el-form-item>
						</el-col>
						<el-col :span="12">
							<el-form-item label="接待人员" prop="createBy" v-if="dataForm.client != 'web_company'">
								<el-input v-model="dataForm.createBy" placeholder="请输入接待人员名称" clearable :disabled="canEdit"
									:style="{ width: '100%' }"></el-input>
							</el-form-item>
						</el-col>
						<el-col :span="24">
							<el-form-item label="房间编号" prop="applyHouse" v-if="dataForm.client != 'web_company'">
								<el-input v-model="dataForm.applyHouse" placeholder="请输入房间编号" clearable :disabled="canEdit"
									:style="{ width: '100%' }"></el-input>
							</el-form-item>
						</el-col>
						<el-col :span="24">
							<el-form-item label="维修分类" prop="applyCategory" v-if="dataForm.client != 'web_company'">
								<el-select v-model="dataForm.applyCategory" placeholder="请选择维修分类">
									<el-option v-for="item in options" :key="item.value" :label="item.label" :disabled="canEdit"
										:value="item.value">
									</el-option>
								</el-select>
							</el-form-item>
						</el-col>
						<el-col :span="24">
							<el-form-item label="报修内容" prop="applyContent">
								<el-input v-model="dataForm.applyContent" placeholder="请输入报修的内容说明" :maxlength="200" :disabled="canEdit"
									:style="{ width: '100%' }" true type="textarea" :rows="3" />
							</el-form-item>
						</el-col>
					</div>
				</el-card>
				<el-card style="margin-top: 5px;">
					<div slot="header">
						<span>回访信息</span>
					</div>
					<div>
						<el-col :span="12">
							<el-form-item label="回访人" prop="returnUser" :maxlength="20">
								<el-input v-model="dataForm.returnUser" placeholder="请输入回访人" />
							</el-form-item>
						</el-col>
						<el-col :span="12">
							<el-form-item label="回访时间" prop="endTime" :maxlength="20">
								<el-input v-model="dataForm.endTime" placeholder="请输入回访时间" />
							</el-form-item>
						</el-col>
						<el-col :span="12">
							<el-form-item label="回访结果" prop="returnResult " :maxlength="20">
								<el-input v-model="dataForm.returnResult" placeholder="请输入回访结果" />
							</el-form-item>
						</el-col>
					</div>
				</el-card>
				</el-row>
			</el-form>
			<span slot="footer" class="dialog-footer" v-if="!canEdit">
				<el-button @click="payAReturnVisit = false">取 消</el-button>
				<el-button type="primary" @click="verify()">确 定</el-button>
			</span>
		</el-dialog>
		<el-dialog title="关单" :visible.sync="customsDeclaration" :close-on-click-modal="false"
			:close-on-press-escape="false" width="40%">
			<el-form ref="form" :model="dataForm" :rules="rules" label-width="90px">
				<el-card style="margin-top: 5px;">
					<div slot="header">
						<span>关单信息</span>
					</div>
					<div>
						<el-col :span="24">
							<el-form-item label="备注" prop="returnUser" :maxlength="20">
								<el-input v-model="dataForm.remark" placeholder="请输入备注" />
							</el-form-item>
						</el-col>
					</div>
				</el-card>
				</el-row>
			</el-form>
			<span slot="footer" class="dialog-footer" v-if="!canEdit">
				<el-button @click="customsDeclaration = false">取 消</el-button>
				<el-button type="primary" @click="verify()">确 定</el-button>
			</span>
		</el-dialog>
	</div>
</template>

<script>
	// 上传文件
	import {
		selectConfigFlowRepairBlock,
		insertConfigFlowRepairBlock,
		editConfigFlowRepairBlock,
		deleteConfigFlowRepairBlock,
		selectConfigHouseBlock
	} from '@/api/wuye.js'
	import fileUpdata from '@/api/file.config'
	export default {
		name: "wuyefei",
		// 页面数据
		data() {
			return {
				queryParams: {
					currentPage: 1,
					pageSize: 10,
					instanceId: null,
					no: null,
					title: null,
					applyPhone: null,
					applyName: null,
					applyCategory: null,
					applyContent: null,
					applyHouse: null,
					applyTime: null,
					applyImg: null,
					appContent: null,
					appointmentTime: null,
					appTime: null,
					repairUser: null,
					repairMaterialsFee: null,
					repairServiceFee: null,
					repairContent: null,
					returnState: null,
					returnResult: null,
					returnRemark: null,
					endTime: null,
					state: null,
					client: "pc",
				},
				options: [{
					value: '水',
					label: '水'
				}, {
					value: '电',
					label: '电'
				},
				// {
				// 	value: '地暖',
				// 	label: '地暖'
				// }, 
				{
					value: '其他',
					label: '其他'
				}],
				value: '',
				houseList: [],
				dataForm: {
					name: '',
					price: '',
					numType: '',
					client: "pc",
					applyImg: []
				},
				editId: '',
				loading: false,
				list: [],
				total: 0, // 一共多少条数据
				productModel: false,
				rules: {
					client: [{
						required: true,
						message: '请选择报修数据来源',
						trigger: 'blur'
					}],
					applyHouse: [{
						required: true,
						message: '请选择房间编号',
						trigger: 'blur'
					}],
					applyPhone: [{
							required: true,
							message: '报修电话不能为空',
							trigger: 'blur'
						},
						{
							pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
							message: '请输入正确的手机号码',
							trigger: 'blur'
						},
					],
					applyName: [{
						required: true,
						message: '报修者姓名不能为空',
						trigger: 'blur'
					}],
					// applyCategory: [{
					// 	required: true,
					// 	message: '报修分类不能为空',
					// 	trigger: 'change'
					// }],
					applyContent: [{
						required: true,
						message: '报修的内容不能为空',
						trigger: 'blur'
					}],
				},
				typeOptions: [{
						fullName: '常规收费项（商铺）',
						id: 'house'
					},
					{
						fullName: '临时收费项',
						id: 'temp'
					},
					{
						fullName: '押金类收费项',
						id: 'deposit'
					},
				],
				canEdit: false,
				fileHeaders: fileUpdata.headers(),
				fileUrl: "/special/dictionary/files/upload/",
				fileList: [],
				fileList1: [],
				deleteName: [],
				sendWorkModel: false,
				payAReturnVisit: false,
				customsDeclaration: false,
			};
		},
		// 初始化
		mounted() {
			this.getList();
			let myId =  localStorage.getItem("userId");
			console.log('myId',myId)
		},
		// 函数集合
		methods: {
			// 上传成功
			handleAvatarSuccess(res, e) {
				console.log('res', res)
				console.log('e', e)
				if (res.code == 200) {
					var picUrl = res.msg;
					this.fileList.push(picUrl)
					let obj = {
						url: picUrl,
						name: e.name
					}
					this.fileList1.push(obj)
					console.log('this.fileList1', this.fileList1)
				}
			},
			//  上传失败
			handleAvatarError(err) {
				this.$message({
					message: '上传失败',
					type: 'warning'
				})
			},
			lookProduct(row) {
				this.canEdit = true;
				this.dataForm = row;
				this.productModel = true;
			},
			// 回访
			interview(row) {
				this.canEdit = true;
				this.dataForm = row;
				this.payAReturnVisit = true;
			},
			// 关单
			off(row) {
				this.dataForm = row;
				this.customsDeclaration = true;
			},
			searchHouse() {
				selectConfigHouseBlock({
					name: this.dataForm.applyHouse
				}).then(res => {
					this.houseList = res.rows;
				})
			},
			// 修改投诉
			editProduct(row) {
				this.editId = row.id
				this.deleteName = []
				this.canEdit = false;
				if (row.id) {
					// 修改
					this.dataForm = row;
					if(this.dataForm.applyImg){
						this.fileList = JSON.parse(this.dataForm.applyImg);
					}
					console.log(this.fileList)
					this.fileList.forEach(item => {
						item.url = 'https://www.ansteelproperty.com' + item.url;
					});
					// http://111.173.119.234:31231//special/dictionary/files/upload/
				} else {
					// 新增 
					this.fileList = []
					this.dataForm.applyImg = []
					this.dataForm = {};
				}
				this.productModel = true;
			},
			sendWork(row) {
				this.dataForm = row;
				this.sendWorkModel = true;
			},
			// 删除投诉
			delProduct(row) {
				// if()
				console.log('id',id)
				this.$confirm("是否删除？", "提示", {
						confirmButtonText: "确 认",
						cancelButtonText: "取 消"
					}).then(() => {
						deleteConfigFlowRepairBlock({
							...row
						}).then(res => {
							if (res.code == 200) {
								this.$message({
									message: res.msg,
									type: 'success',
									duration: 1000,
									onClose: () => {
										this.visible = false;
										this.$message.success("删除投诉成功");
										this.getList();
									},
								});
							}
						})
					})
					.catch(() => console.info("操作取消"));
			},
			// 派工提交
			submitProduct1() {
				this.dataForm = {
					state: "已派工",
					appointmentTime: this.dataForm.appointmentTime,
					repairUserName: this.dataForm.repairUserName,
					id: this.dataForm.id,
				}
				console.log(this.dataForm)
				this.$refs['form'].validate(valid => {
					if (valid) {
						editConfigFlowRepairBlock({
							...this.dataForm
						}).then(res => {
							if (res.code == 200) {
								this.$message({
									message: res.msg,
									type: 'success',
									duration: 1000,
									onClose: () => {
										this.sendWorkModel = false;
										this.getList();
									},
								});
							}
						})
					}
				})
			},
			// 回访结果
			verify() {
				this.dataForm = {
					state: "已回访",
					appointmentTime: this.dataForm.appointmentTime,
					repairUserName: this.dataForm.repairUserName,
					id: this.dataForm.id,
				}
				console.log(this.dataForm)
				this.$refs['form'].validate(valid => {
					if (valid) {
						editConfigFlowRepairBlock({
							...this.dataForm
						}).then(res => {
							if (res.code == 200) {
								this.$message({
									message: res.msg,
									type: 'success',
									duration: 1000,
									onClose: () => {
										this.sendWorkModel = false;
										this.getList();
									},
								});
							}
						})
					}
				})
			},
			//提交投诉
			submitProduct() {
				// this.dataForm.state = "待派工";
				delete this.dataForm.state;
				this.dataForm.client = "pc";
				let getId = this.deleteName.map(item => item.name)
				let newArr = this.fileList1.filter(item => !getId.includes(item.name))
				// let url = newArr.filter(item => item.url).map(item => item.url);
				this.dataForm.applyImg = newArr
				console.log('this.fileList', this.fileList)
				this.$refs['form'].validate(valid => {
					if (valid) {
						if (this.editId) {
							editConfigFlowRepairBlock({
								...this.dataForm
							}).then(res => {
								if (res.code == 200) {
									this.$message({
										message: res.msg,
										type: 'success',
										duration: 1000,
										onClose: () => {
											this.productModel = false;
											this.getList();
										},
									});
								}
							})
						} else {
							insertConfigFlowRepairBlock({
								...this.dataForm
							}).then(res => {
								if (res.code == 200) {
									this.$message({
										message: res.msg,
										type: 'success',
										duration: 1000,
										onClose: () => {
											this.productModel = false;
											this.getList();
										},
									});
								}
							})
						}
					}
				})

			},
			//初始化列表
			getList() {
				this.loading = false;
				selectConfigFlowRepairBlock({
					...this.queryParams
				}).then(res => {
					this.list = res.rows;
					this.total = res.total
				})
			},
			// 删除图片
			handleRemove(file) {
				let obj = {
					name: file.name
				}
				this.deleteName.push(obj)
			},
			onChange(file, fileList) {
				console.log('111', fileList);
			},
			handlePreview(file) {
				console.log(file);
			},
			handleExceed(files, fileList) {
				this.$message.warning(`当前限制选择 3 个文件，本次选择了 ${files.length} 个文件，共选择了 ${files.length + fileList.length} 个文件`);
			},
			beforeRemove(file, fileList) {
				return this.$confirm(`确定移除 ${ file.name }？`);
			},
			reset() {
				this.queryParams = {
					pageNum: 1,
					pageSize: 10
				};
				this.resetForm('form');
			},

		}
	}
</script>
<style scoped lang='scss'>
	.editBtn span {
		color: red;
	}

	.deleteBtn span {
		color: red;
	}

	.detailBtn span {
		color: red;
	}

	.el-date-editor.el-input,
	.el-date-editor.el-input__inner {
		width: 100%;
	}

	.detailForm {
		.el-form-item {
			margin-bottom: 0px;
		}
	}

	.centered-content {
		display: flex;
		justify-content: center;
		align-items: center;
	}

	/* 	.el-upload-list--text li{
		position: relative !important;
		top: -60px !important;
		left: 120px !important;
	} */
</style>